package com.bpzj.db.mongo;

import com.bpzj.db.mongo.document.Country;
import com.bpzj.db.mongo.document.CountryCodec;
import org.bson.codecs.Codec;
import org.bson.codecs.configuration.CodecProvider;
import org.bson.codecs.configuration.CodecRegistry;

public class MyCodecProvider implements CodecProvider {

  @Override
  public <T> Codec<T> get(Class<T> clazz, CodecRegistry registry) {
    if (clazz == Country.class) {
      return (Codec<T>) new CountryCodec(registry);
    }
    return null;
  }
}
